package cn.wolfcode.trip.app.web.controller;
import cn.wolfcode.trip.base.domain.Hotel;
import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.query.HotelQueryObject;
import cn.wolfcode.trip.base.service.IHotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
 * 酒店选择控制器
 */
@RestController
@RequestMapping("/hotels")
public class HotelController {
    @Autowired
    private IHotelService hotelService;
    /**
     * 酒店高查
     * @param qo
     * @return
     */
    @GetMapping
    public Object getList(HotelQueryObject qo){

        return hotelService.query(qo);
    }

    @GetMapping("/{id}")
    public Hotel getTravelById(@PathVariable Long id){
        Hotel hotel = hotelService.get(id);
        return hotel;
    }
}
